//
//  AppUIConfig.m
//  industry
//
//  Created by xl on 2020/11/11.
//  Copyright © 2020 Haier. All rights reserved.
//

#import "AppUIConfig.h"

@implementation AppUIConfig
- (instancetype)init
{
    self = [super init];
    if (self) {
        
    }
    return self;
}

- (void)configUI
{
    //设置UI默认项
//    [[XLSharedWebView sharedXLSharedWebView] loadWebView];//加载默认的webview
    
//    UIImage *backImage = XLIMAGE(@"icon_back_hei");
//    [[UINavigationBar appearance] setBackIndicatorImage:backImage];//自定义返回图片
//    [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:backImage];
//    [[UINavigationBar appearance] setTitleTextAttributes:@{
//                                                           NSForegroundColorAttributeName:[UIColor blackFontColor],
//                                                           NSForegroundColorAttributeName:[UIFont systemFontOfSize:18],}];//Nav Title富文本样式
//    [[UINavigationBar appearance] setShadowImage:[UIImage new]];
//    [[UINavigationBar appearance] setBackgroundImage:XLIMAGE(@"transparentBg") forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
    

//    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageWithColor:[UIColor whiteColor] size:CGSizeMake(1, 1)] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
    
    [[UITabBar appearance] setBackgroundColor:[UIColor clearColor]];
    UIImage *image = XLIMAGE(@"img_tab_bg");
    UIImage *newImage;
    if (image.size.width >= SCREEN_WIDTH) {
        newImage = [image resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0) resizingMode:UIImageResizingModeStretch];
    } else {
        newImage = [image resizableImageWithCapInsets:UIEdgeInsetsMake(image.size.height - 1, 0, 0, 0) resizingMode:UIImageResizingModeStretch];
    }
    [[UITabBar appearance] setBackgroundImage:newImage];
    [[UITabBar appearance] setShadowImage:[UIImage new]];

    [[XLTableView appearance] setBackgroundColor:[UIColor colorWithHex:0XFFFFFF]];
    [[XLCollectionView appearance] setBackgroundColor:[UIColor colorWithHex:0XFFFFFF]];
    [[XLLabel appearance] setBackgroundColor:[UIColor clearColor]];
    
    [[UIScrollView appearance] setShowsVerticalScrollIndicator:NO];
    [[UIScrollView appearance] setShowsHorizontalScrollIndicator:NO];
    [[XLTableView appearance] setSeparatorStyle:UITableViewCellSeparatorStyleNone];

    if (@available(iOS 11.0, *)) {
        [[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
    } else {
        // Fallback on earlier versions
    }
}
@end
